// 攻略删除
const express = require('express')
const router = express.Router()
const pool = require('../pool')
// http://127.0.0.1:3000/users/delstrategy
router.get('/:sid', (req, res, next) => {
  var obj = req.params
  console.log(req.params)
  let sql = 'delete from qnls_strategy where sid = ?'
  pool.query(sql, [obj.sid], (err, result) => {
    if (err) {
      return next(err)
    }
    if (result.affectedRows === 0) {
      res.send({ code: 400, msg: '攻略删除失败', data: result })
    } else {
      res.send({ code: 200, mag: '该攻略删除成功', data: result })
    }
  })
})

module.exports = router
